/*
        forEach     
        map         
        where       
        any
        every
*/

void main() {
  List myList = ['苹果', '香蕉', '雪梨', '雪梨', '包子', '粉肠', '香蕉', '香蕉'];

  for (var item in myList) {
    print(item);
  }

  print('---------------');

  myList.forEach((item) {
    print("$item");
  });

  print('---------------');

  List myNum = [1, 3, 4, 8, 9, 10];

  var newList = myNum.map((value) {
    return value * 2;
  });

  print(newList.toList());

  print('-------where--------');

  var whereList = myNum.where((value) {
    return value > 5;
  });

  print(whereList.toList());

  print('-------any--------');

  //任意一个满足条件
  var anyList = myNum.any((value) {
    return value > 5;
  });

  print(anyList);

  print('-------every--------');

  //每一个都要满足条件
  var everyList = myNum.every((value) {
    return value > 5;
  });

  print(everyList);
}
